package com.aaa.markdowntest;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.TextView;

import com.yuan.lib_markdownview.MarkDownFileUtil;
import com.yuan.lib_markdownview.MarkdownWebView;

import java.io.IOException;

public class MainActivity extends AppCompatActivity {
    private static final String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        TextView textView = findViewById(R.id.hello_world);
        MarkdownWebView markdownWebView = findViewById(R.id.markdown_view);

        textView.setOnClickListener(view -> {
            try {
                markdownWebView.setText(MarkDownFileUtil.getString(getApplicationContext()));
            } catch (IOException e) {
                e.printStackTrace();
            }
        });
    }
}
